﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:ad="clr-namespace:AvalonDock">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/AvalonDock;component/Resources/Brushes.xaml"/>
        <ResourceDictionary Source="/AvalonDock;component/Resources/Common.xaml"/>
    </ResourceDictionary.MergedDictionaries>


    <Style TargetType="{x:Type ad:DockableFloatingWindow}">
        <Setter Property="Title" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=HostedPane.SelectedItem.Title}"/>
        <Setter Property="Background" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DefaultBackgroundBrush}}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ad:DockableFloatingWindow}">
                    <Border Background="{TemplateBinding Background}">
                        <ContentPresenter
                            ad:ResizingPanel.ResizeWidth="{TemplateBinding ad:ResizingPanel.ResizeWidth}"
                            ad:ResizingPanel.ResizeHeight="{TemplateBinding ad:ResizingPanel.ResizeHeight}"/>
                    </Border><!---->
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type ad:DocumentFloatingWindow}">
        <Setter Property="Background" Value = "Transparent"/>
        <Setter Property="Width" Value="100"/>
        <Setter Property="Height" Value="100"/>
        <Setter Property="Title" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=HostedPane.SelectedItem.Title}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ad:DocumentFloatingWindow}">
                    <Grid>
                        <Border 
                            x:Name="PART_HighlighBorder"
                            Visibility="Visible"
                            Background="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}" 
                            Opacity="0.2"/>
                        <ContentPresenter
                            x:Name="PART_Content"
                            Visibility="Collapsed"
                            ad:ResizingPanel.ResizeWidth="{TemplateBinding ad:ResizingPanel.ResizeWidth}"
                            ad:ResizingPanel.ResizeHeight="{TemplateBinding ad:ResizingPanel.ResizeHeight}"/>
                    </Grid><!---->
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsDocumentFloatingAllowed}" Value="True">
                            <Setter Property="Visibility" Value="Collapsed" TargetName="PART_HighlighBorder"/>
                            <Setter Property="Visibility" Value="Visible" TargetName="PART_Content"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type ad:FloatingDockablePane}">
        <Setter Property="ShowHeader" Value="False"/>
        <Setter Property="Background" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DefaultBackgroundBrush}}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ad:FloatingDockablePane}">
                    <Border Background="{TemplateBinding Background}">
                        <ContentPresenter />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    
    <Style TargetType="{x:Type ad:FlyoutPaneWindow}">
        <Setter Property="Background" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DefaultBackgroundBrush}}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ad:FlyoutPaneWindow}">
                    <Grid Name="INT_resizePanel" Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ContentPresenter Name="INT_pane" Grid.Column="1" Grid.Row="1"/>
							<Border Name="INT_Resizer" Grid.Column="2" Grid.Row="1" 
								Background="Transparent"/> <!--{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DefaultBackgroundBrush}}}"-->
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Anchor}" Value="Right">
                            <Setter Property="Grid.Row" Value="1" TargetName="INT_Resizer"/>
                            <Setter Property="Grid.Column" Value="0" TargetName="INT_Resizer"/>
                            <Setter Property="Width" Value="4" TargetName="INT_Resizer"/>
                            <Setter Property="Cursor" Value="SizeWE" TargetName="INT_Resizer"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Anchor}" Value="Left">
                            <Setter Property="Grid.Row" Value="1" TargetName="INT_Resizer"/>
                            <Setter Property="Grid.Column" Value="2" TargetName="INT_Resizer"/>
                            <Setter Property="Width" Value="4" TargetName="INT_Resizer"/>
                            <Setter Property="Cursor" Value="SizeWE" TargetName="INT_Resizer"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Anchor}" Value="Bottom">
                            <Setter Property="Grid.Column" Value="1" TargetName="INT_Resizer"/>
                            <Setter Property="Grid.Row" Value="0" TargetName="INT_Resizer"/>
                            <Setter Property="Height" Value="4" TargetName="INT_Resizer"/>
                            <Setter Property="Cursor" Value="SizeNS" TargetName="INT_Resizer"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Anchor}" Value="Top">
                            <Setter Property="Grid.Row" Value="2" TargetName="INT_Resizer"/>
                            <Setter Property="Grid.Column" Value="1" TargetName="INT_Resizer"/>
                            <Setter Property="Height" Value="4" TargetName="INT_Resizer"/>
                            <Setter Property="Cursor" Value="SizeNS" TargetName="INT_Resizer"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--<Style TargetType="{x:Type ad:FlyoutPaneWindow}">
        <Style.Resources>
            <Storyboard x:Key="ClosingStoryboard">
                
                <DoubleAnimation
                            Storyboard.TargetName="{x:Null}"
                            Storyboard.TargetProperty="(ad:ResizingPanel.ResizeHeight)"
                            To="0" Duration="0:0:0.200" />
                <DoubleAnimation
                            Storyboard.TargetName="{x:Null}"
                            Storyboard.TargetProperty="(ad:ResizingPanel.ResizeWidth)"
                            To="0" Duration="0:0:0.200" />
                <DoubleAnimation
                            Storyboard.TargetName="{x:Null}"
                            Storyboard.TargetProperty="Opacity"
                            To="0" Duration="0:0:0.200" />
                <DoubleAnimation
                            Storyboard.TargetName="{x:Null}"
                            Storyboard.TargetProperty="Height"
                            To="0" Duration="0:0:0.200" />
                <DoubleAnimation
                            Storyboard.TargetName="{x:Null}"
                            Storyboard.TargetProperty="Width"
                            To="0" Duration="0:0:0.200" />
                <DoubleAnimation
                            Storyboard.TargetName="{x:Null}"
                            Storyboard.TargetProperty="Opacity"
                            To="0" Duration="0:0:0.200" />
            </Storyboard>
        </Style.Resources>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ad:FlyoutPaneWindow}">
                    <ad:ResizingPanel Name="INT_resizePanel" Orientation="Vertical">
                        <ContentPresenter Name="INT_pane"
                                          ad:ResizingPanel.ResizeWidth="{TemplateBinding ad:ResizingPanel.ResizeWidth}"
                                          ad:ResizingPanel.ResizeHeight="{TemplateBinding ad:ResizingPanel.ResizeHeight}"/>
                        <Border Name="INT_dummySpace" />
                    </ad:ResizingPanel>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Anchor" Value="Left" >
                            
                            <Setter Property="ad:ResizingPanel.Orientation" Value="Horizontal" TargetName="INT_resizePanel"/>
                            <Setter Property="ad:ResizingPanel.ResizingDirection" Value="Direct" TargetName="INT_resizePanel"/>
                        </Trigger>
                        <Trigger Property="Anchor" Value="Right" >
                            
                            <Setter Property="ad:ResizingPanel.Orientation" Value="Horizontal" TargetName="INT_resizePanel"/>
                            <Setter Property="ad:ResizingPanel.ResizingDirection" Value="Inverse" TargetName="INT_resizePanel"/>
                        </Trigger>
                        <Trigger Property="Anchor" Value="Top"  >
                           
                            <Setter Property="ad:ResizingPanel.Orientation" Value="Vertical" TargetName="INT_resizePanel"/>
                            <Setter Property="ad:ResizingPanel.ResizingDirection" Value="Direct" TargetName="INT_resizePanel"/>
                        </Trigger>
                        <Trigger Property="Anchor" Value="Bottom" >
                            
                            <Setter Property="ad:ResizingPanel.Orientation" Value="Vertical" TargetName="INT_resizePanel"/>
                            <Setter Property="ad:ResizingPanel.ResizingDirection" Value="Inverse" TargetName="INT_resizePanel"/>
                        </Trigger>
                        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation
                                        Storyboard.TargetName="INT_pane"
                                        Storyboard.TargetProperty="(ad:ResizingPanel.ResizeHeight)"
                                        From="0" Duration="0:0:0.200" />
                                    <DoubleAnimation
                                        Storyboard.TargetName="INT_pane"
                                        Storyboard.TargetProperty="(ad:ResizingPanel.ResizeWidth)"
                                        From="0" Duration="0:0:0.200" />
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>-->
</ResourceDictionary>